<?php

function convert_new_line($text) {
	return str_replace(PHP_EOL,"<br>",$text);
}

function to_sjis($text, $escape_eol = TRUE) {
	if ($escape_eol) $text = str_replace(PHP_EOL,"<br>",$text);
	$text = mb_convert_encoding($text, 'sjis', 'utf8');
	return $text;
}

function to_utf($text) {
	$text = mb_convert_encoding($text, 'utf8', 'sjis');
	return $text;
}

